<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/11/7
  Time: 14:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市账单管理系统</title>
    <link rel="stylesheet" href="${pageContext.servletContext.contextPath}/statics/css/public.css"/>
    <link rel="stylesheet" href="${pageContext.servletContext.contextPath}/statics/css/style.css"/>
</head>
<body>
<!--头部-->
<jsp:include page="comon/header.jsp"></jsp:include>
<!--主体内容-->
<section class="publicMian">
    <jsp:include page="comon/left.jsp"></jsp:include>
    <div class="right">
        <div class="location">
            <strong>你现在所在的位置是:</strong>
            <span>用户管理页面</span>
        </div>
        <form method="get" action="${pageContext.servletContext.contextPath}/user/list">
        <div class="search">
            <span>用户名：</span>
            <input type="text"  name="userName" value="${userName}" placeholder="请输入用户名"/>
            <span>角色：</span>
            <select name="userRole">
                <option value="0">
                    全部
                </option>
                <option value="1">
                    超级管理员
                </option>
                <option value="2">
                    经理
                </option>
                <option value="3">
                    普通用户
                </option>
            </select>
            <input type="button" onclick="page_nav(document.forms[0],1)"  value="查询"/>
            <input name="pageNo" type="hidden" value="1"/>
            <a href="adduser2">添加用户</a>
        </div>
        </form>
        <!--用户-->
        <table class="providerTable" cellpadding="0" cellspacing="0">
            <tr class="firstTr">
                <th width="10%">用户编码</th>
                <th width="20%">用户名称</th>
                <th width="10%">性别</th>
                <th width="10%">年龄</th>
                <th width="10%">电话</th>
                <th width="10%">用户类型</th>
                <th width="30%">操作</th>
            </tr>
        <c:forEach items="${data}" var="user" varStatus="index">
            <tr>
                <td>${user.userCode}</td>
                <td>${user.userName}</td>
                <td>${user.gender==1?"男":"女"}</td>
                <td>${user.age}</td>
                <td>${user.phone}</td>
                <td>${user.userRole==1?"超级管理員":user.userRole==2?"经理":"普通用户"}</td>
                <td>
                    <a href="view/${user.id}"><img src="${pageContext.servletContext.contextPath}/statics/img/read.png" alt="查看" title="查看"/></a>
                    <a href="userUpdate.html"><img src="${pageContext.servletContext.contextPath}/statics/img/xiugai.png" alt="修改" title="修改"/></a>
                    <a href="#" class="removeUser"><img src="${pageContext.servletContext.contextPath}/statics/img/schu.png" alt="删除" title="删除"/></a>
                </td>
            </tr>
        </c:forEach>
        </table>
        <c:import url="comon/rollpage.jsp">
            <c:param name="totalcount" value="${totalcount}"></c:param>
            <c:param name="pageNo" value="${pageNo}"></c:param>
            <c:param name="totalPage" value="${totalPage}"></c:param>
        </c:import>
    </div>

</section>
<jsp:include page="comon/foot.jsp"></jsp:include>
</body>
</html>
